package com.example.taobao;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.TextView;


import java.util.List;

public class personAdapte extends ArrayAdapter<Huowu> {
    private int resourceId;

    public personAdapte(Context context, int resource, List<Huowu> objects) {
        super(context, resource,objects);
        resourceId =resource;
    }


    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        Huowu person = getItem(position);
        View view = LayoutInflater.from(getContext()).inflate(resourceId,parent,false);
        TextView textView1 = view.findViewById(R.id.tv_goods_name);
        TextView textView2 = view.findViewById(R.id.tv_goods_price);
        TextView textView3 = view.findViewById(R.id.tv_type_size);
        TextView textView4 = view.findViewById(R.id.tv_num);
        CheckBox checkBox = view.findViewById(R.id.check_box);
//        TextView textView5 = view.findViewById(R.id.);
        textView1.setText(person.getMinchen());
        textView2.setText(person.getJiage()+"");
        textView3.setText(person.getType());
        textView4.setText(person.getCount()+"");
        checkBox.setChecked(false);
//        textView5.setText(person.getAddress())
        return view;
    }
}

